package com.yzf.demo.demo.ReflectionMechanism;

import java.lang.reflect.Field;

/**
 * Created by 于占峰 on 2020/3/24/024.
 */
public class GetDeclaredFields {
    public static void main(String[] args) throws NoSuchFieldException {
        Class clazz = DemoBean.class;
        Field[] fields = clazz.getDeclaredFields();
        Field field = clazz.getDeclaredField("name");
        System.out.println(fields.length);
        System.out.println(field);
    }

}
